//
//  Tools.m
//  Day8
//
//  Created by wenjim on 17/10/26.
//  Copyright © 2017年 WenJim. All rights reserved.
//

#import "Tools.h"

@implementation Tools

implementationSingleton(Tools);

/*
+ (instancetype)shareTools
{
    Tools * instance = [[self alloc] init];
    return instance;
}

static Tools * _instance = nil;
+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
    
    // 以下代码在多线程中也能保证只执行一次
    static dispatch_once_t onceToKen;
    dispatch_once(&onceToKen, ^{
        _instance = [[super allocWithZone:zone] init];
    });
    return _instance;
}

// copyWithZone 方法用什么调用？对象
-(id)copyWithZone:(NSZone *)zone
{
    return _instance;
}


-(id)mutableCopyWithZone:(NSZone *)zone
{
    
    return _instance;
}

- (oneway void)release
{
}

-(instancetype)retain
{
    return _instance;
}

- (NSUInteger)retainCount
{
    return MAXFLOAT;
}
 */
@end
